<?php use_stylesheet('/enermaatik/isik.css') ?>
<?php slot('article') ?>
<?php include_component('memberzoneMenu', 'render') ?>
<?php include_component('headerMenu', 'breadCrumbs') ?>
<div class="clear"></div>
<form action="<?php echo LinkGen::getInstance(LinkGen::STRUCTURE_ACTIONS)->link(null, array('module' => 'memberzoneUserData', 'action' => 'submit')) ?>" method="post">
<?php echo $form->renderHiddenFields(true) ?>
<div class="ccontentbox">
	<div class="ccontent">
		<div class="korvsisu">
			<h1><?php echo $node['pageTitle'] ?></h1>
			<div id="comment_flashes"></div>
			<div class="korvinfobox andmed">
				<div class="andmerow">
					<div class="arowname">
						<p><?php echo __('first name') ?></p>
					</div>

					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['first_name']->render(array('class' => 'ainput')) ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
					</div>

					</div>
					<div class="akohustlik">
						<img src="/enermaatik/img/koh.png" width="6" height="4" alt=""/>
					</div>
					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p><?php echo __('last name') ?></p>

					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['last_name']->render(array('class' => 'ainput')) ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>

					</div>
					</div>
					<div class="akohustlik">
						<img src="/enermaatik/img/koh.png" width="6" height="4" alt=""/>
					</div>
					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p><?php echo __('Phone') ?></p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['phone']->render(array('class' => 'ainput')) ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
					</div>
					</div>
					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p><?php echo __('Birth year') ?></p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['birth_year']->render(array('class' => 'ainput')) ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
					</div>
					</div>
					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p><?php echo __('Birth month') ?></p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['birth_month']->render(array('class' => 'ainput')) ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
					</div>
					</div>
					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p><?php echo __('Birth day') ?></p>
					</div>
					<div class="aform">
						<div class="aformcontent">
							<div class="formleft"><img src="/enermaatik/img/formleft.png" width="10" height="30" alt=""/></div>
							<div class="formcenter">
								<?php echo $form['birth_day']->render(array('class' => 'ainput')) ?>
							</div>
							<div class="formright"><img src="/enermaatik/img/formright.png" width="10" height="30" alt=""/></div>
						<div class="clear"></div>
					</div>
					</div>
					<div class="clear"></div>
				</div>
				<div class="andmerow">
					<div class="arowname">
						<p><?php echo __('Soovin saada uudiskirju'); ?></p>
					</div>
					<div class="aform">
                                                <?php echo $form['newslist']->render(array('style' => 'margin-top:10px;')) ?>
					</div>

					<div class="clear"></div>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="ccontentmainbottom"></div>
		<div class="clear"></div>
		<div class="tablebuttons">
			<div class="hallbutton">
				<div class="hallbuttonleft"><img src="/enermaatik/img/tbl.png" width="8" height="26" alt=""/></div>
				<div class="hallbuttoncenter">
					<p><a id="submit_button" href="#"><?php echo __('Salvesta') ?></a></p>
				</div>

				<div class="hallbuttonright"><img src="/enermaatik/img/tbr.png" width="8" height="26" alt=""/></div>
				<div class="clear"></div>
			</div>
			<div class="clear"></div>
		</div>
	</div>
</div>
</form>

<script type="text/javascript">
$('#submit_button').click(function(e){
	e.preventDefault();


	var button = $(this);
	var form = button.parents('form');

	button.hide();

	$('#comment_flashes').html('');

	$.post(form.attr('action'), form.serialize(), function(data){
		button.show();


		if(data.status == 200){
			$('#comment_flashes').html(data.shortMessage);
		}else{
			for (var i in data.messages ){
				$('#comment_flashes').html( $('#comment_flashes').html() + "<br />" +  data.messages[i]);
			}
			button.show();
		}

	}, 'json');

	return false;
});
</script>
<?php end_slot() ?>
